package admin

import "github.com/google/uuid"

type GetClientMessagesRequest struct {
	ConversationID string `query:"conversation_id" validate:"omitempty,uuid"`
	Page           int    `query:"page" validate:"omitempty,min=1"`
	Limit          int    `query:"limit" validate:"omitempty,min=1,max=100"`
}

type GetClientMessagesResponse struct {
	Rows       []ClientMessageRow `json:"rows"`
	Total      int64              `json:"total"`
	Page       int                `json:"page"`
	Limit      int                `json:"limit"`
	TotalPages int64              `json:"total_pages"`
}

type ClientMessageRow struct {
	ID             uuid.UUID `json:"id"`
	ConversationID uuid.UUID `json:"conversation_id"`
	Role           string    `json:"role"`
	Content        string    `json:"content"`
	CreatedAt      int64     `json:"created_at"`
	// 扩展字段
	Status         *string `json:"status,omitempty"`
	ProcessingTime *int64  `json:"processing_time,omitempty"`
	Model          *string `json:"model,omitempty"`
	TokensUsed     *int    `json:"tokens_used,omitempty"`
	ErrorMessage   *string `json:"error_message,omitempty"`
}

// ClientMessageDetail 包含完整信息的客户端消息详情
type ClientMessageDetail struct {
	ClientMessageRow
	UserID                 uuid.UUID `json:"user_id"`
	UpdatedAt              int64     `json:"updated_at"`
	StartInternalMessageID *uint     `json:"start_internal_message_id,omitempty"`
}
